#include <iostream>
using namespace std;

// 值的捕获和参数传递中的值传递类似， 被捕获的变量的值在lambda表达式创建时通过值拷贝的方式传入， 随后对该变量的修改不会影响lambda表达式创建时的值
int main(int argc, char const *argv[])
{
    int c;
    int a = 100;
    auto lambda = [a] {
        int result = a + 10;
        return result;
    };
    a = 200;
    c = lambda();
    cout << "a = " << a << ", c = " << c << endl;
    return 0;
}
